package waysToStep;

public class Solution {
    public int waysToStep(int n) {
        if(n == 1){
            return 1; // 1
        }
        if(n == 2){
            return 2; // 11 2
        }
        if(n == 3){
            return 4; // 111 12 21 3
        }
        int a = 1,b = 2, c = 4, res = 7;

        for (int i = 5; i <= n ; i++) {
            res = ((a + b)%1000000007 + c)%1000000007;
            a = b;
            b = c;
            c = res;
        }
        return res;
    }
}
